package demo1;

import java.util.Iterator;
import java.util.LinkedList;

import static javax.swing.UIManager.get;

public class test {
    @SuppressWarnings({"all"})
    public static void main(String[] args) {
        LinkedList linkedlist = new LinkedList();
        linkedlist.add(1);
        linkedlist.add(2);
        linkedlist.add(23);
        linkedlist.add(24);
        System.out.println(linkedlist);
        linkedlist.remove();
        System.out.println(linkedlist);
        linkedlist.set(1,666);
        System.out.println(linkedlist);

        Iterator iterator = linkedlist.iterator();
        while (iterator.hasNext()) {
            Object next =  iterator.next();
            System.out.println(next);
        }

        for (Object o : linkedlist) {
            System.out.println(o);
        }

        for(int i=0;i<linkedlist.size();i++){
            System.out.println(linkedlist.get(i));
        }

    }
}
